<template>
    <div>
        <!-- <h3>当前最新的count值为:{{count}}</h3> -->
        <h3>{{showNum}}</h3>
        <button @click="sub">-1</button>
        <button @click="handlebtnClick3">-n</button>
        <button @click="handlebtnClick4">异步-1</button>
        <button @click="handlebtnClick5">异步-n</button>
    </div>
</template>

<script>
import { mapState } from 'vuex'
import { mapActions } from 'vuex'
import { mapMutations } from 'vuex'
import { mapGetters } from 'vuex'
export default {
    data(){
        return {
            
        }
    },
    methods:{
        ...mapActions(['subAsync','subNAsync']),
        ...mapMutations(['sub','subN']),
        handlebtnClick3(){
            this.subN(3)
        },
        handlebtnClick4(){
            this.subAsync();
        },
        handlebtnClick5(){
            this.subNAsync(3)
        }
    },
    computed:{
        ...mapGetters(['showNum']),
        ...mapState(['count'])
    }
}
</script>